package top.zywork.vo;

import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * GoodsSkuAttributeValueGroupVO值对象类<br/>
 * <p>
 * 创建于2019-07-14<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
public class GoodsSkuAttributeValueGroupVO extends BaseVO {

    private static final long serialVersionUID = -9223372035073454685L;

    /*
     * t_goods_info表的字段对应的属性
     */
    /**
     * 商品编号
     */
    private Long goodsInfoId;
    /**
     * 店铺编号
     */
    @NotNull(message = "此项是必须项")
    private Long goodsInfoShopId;
    /**
     * 店铺Logo
     */
    private String goodsShopLogo;
    /**
     * 店铺标题
     */
    private String goodsShopTitle;
    /**
     * 类目编号
     */
    @NotNull(message = "此项是必须项")
    private Long goodsInfoCategoryId;
    /**
     * 商品图片
     */
    private String goodsInfoPicUrl;
    /**
     * 商品品牌
     */
    private String goodsInfoBrand;
    /**
     * 商品标题
     */
    @NotBlank(message = "此项是必须项")
    @Size(min = 1, max = 100, message = "必须是1-100个字符")
    private String goodsInfoTitle;
    /**
     * 图文详情
     */
    @NotBlank(message = "此项是必须项")
    @Size(min = 1, max = 65535, message = "必须是1-65535个字符")
    private String goodsInfoIntro;
    /**
     * 上架状态
     */
    private Byte goodsInfoShelfStatus;
    /**
     * 销量
     */
    private Long goodsInfoSaleCount;
    /**
     * 点击数
     */
    private Long goodsInfoClickCount;

    /**
     * 自定义的用于商品活动计数的属性
     */
    private Long hotCount;
    private Long agentCount;
    private Long grouponCount;
    private Long seckillCount;
    private Long promotionCount;

    private List<GoodsSkuVO> goodsSkuVOList;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class GoodsSkuVO {
        /*
         * t_goods_sku表的字段对应的属性
         */
        /**
         * SKU编号
         */
        @NotNull(message = "此项是必须项")
        private Long goodsSkuId;
        /**
         * SKU图片编号
         */
        @NotNull(message = "此项是必须项")
        private Long goodsSkuPicId;
        /**
         * SKU图片
         */
        private String goodsSkuPicUrl;
        /**
         * 售卖标题
         */
        @NotNull(message = "此项是必须项")
        private String goodsSkuTitle;
        /**
         * 原价
         */
        private BigDecimal goodsSkuPrice;
        /**
         * 销售价
         */
        @NotNull(message = "此项是必须项")
        private BigDecimal goodsSkuSalePrice;
        /**
         * 库存
         */
        @NotNull(message = "此项是必须项")
        private Integer goodsSkuStockCount;
        /**
         * 上架状态
         */
        private Byte goodsSkuShelfStatus;

        private List<GoodsSkuAttrVO> goodsSkuAttrVOList;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class GoodsSkuAttrVO {
        /*
         * t_goods_category_attribute表的字段对应的属性
         */
        /**
         * 属性编号
         */
        @NotNull(message = "此项是必须项")
        private Long goodsCategoryAttributeAttrId;
        /**
         * 属性排序
         */
        @NotNull(message = "此项是必须项")
        private Integer goodsCategoryAttributeAttrOrder;
        /**
         * 是否属性组合
         */
        private Byte goodsCategoryAttributeIsAttrGroup;
        /*
         * t_goods_attribute表的字段对应的属性
         */
        /**
         * 属性名称
         */
        @NotBlank(message = "此项是必须项")
        @Size(min = 1, max = 20, message = "必须是1-20个字符")
        private String goodsAttributeAttrName;
        /**
         * 属性代码
         */
        @NotBlank(message = "此项是必须项")
        @Size(min = 1, max = 50, message = "必须是1-50个字符")
        private String goodsAttributeAttrCode;
        /**
         * 数据类型
         */
        @NotBlank(message = "此项是必须项")
        @Size(min = 1, max = 20, message = "必须是1-20个字符")
        private String goodsAttributeAttrType;
        /**
         * 数据长度
         */
        @NotNull(message = "此项是必须项")
        private Integer goodsAttributeAttrLength;
        /**
         * 是否必填
         */
        @NotNull(message = "此项是必须项")
        private Byte goodsAttributeAttrRequired;
        /**
         * 是否前端显示
         */
        @NotNull(message = "此项是必须项")
        private Byte goodsAttributeAttrDisplay;
        /*
         * t_goods_attribute_value表的字段对应的属性
         */
        /**
         * 属性值
         */
        @NotBlank(message = "此项是必须项")
        @Size(min = 1, max = 500, message = "必须是1-500个字符")
        private String goodsAttributeValueAttrValue;
        /**
         * 创建时间
         */
        private Date goodsAttributeValueCreateTime;
    }

}
